home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 369 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  903 b 

  1. Path: solon.com!not-for-mail
  2. From: mskc@io.com (Casey Claiborne)
  3. Newsgroups: comp.lang.c,comp.lang.c.moderated
  4. Subject: Leading and Trailing Blanks
  5. Date: 4 Jan 1996 15:32:27 -0600
  6. Organization: Illuminati Online
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4chh1b$685@solutions.solon.com>
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12.  
  13. Hello -
  14.     I am wondering if anyone out there has a program (or knows of one)
  15. that allows one to strip leading and trailing blanks from a string. 
  16. ex:
  17.  
  18.     char test[20];
  19.     strcpy(test,"  TESTING  ");
  20.     printf("%s", test);
  21.  
  22. will produce an output like
  23.   TESTING  
  24.  
  25. that has blanks at the beginning of "TESTING". I would like to 
  26. have the following result
  27.  
  28. TESTING
  29.  
  30. that has no leading blanks.
  31.  
  32. I would *greatly* appreciate any type of help or hints in working with
  33. this.
  34.  
  35. I'll be looking out here, but e-mails are also appreciated :)
  36.  
  37. TIA
  38.  
  39. Casey
  40.